package com.andyliu.sys.service;

import com.andyliu.sys.dto.ZtreeNodeDto_;
import com.andyliu.sys.pojo.SRole;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * ClassName: RoleService
 * Description: 角色的相关业务
 * date: 2021/1/20 4:48 下午
 *
 * @author andyliu
 * @since JDK 1.8
 */
public interface RoleService {

    Boolean saveRole(SRole role);

    Boolean deleteRoleById(Integer id);

    SRole selectRoleById(Integer id);

    PageInfo<SRole> selectRoleByPage(SRole role,Integer pageNumber,Integer pageSize);

    Boolean deleteRoleById(Integer[] ids);

    List<SRole> queryRoles();

    /**
     * 查询细粒度权限
     * @param roleId
     * @return
     */
    List<String> selectPermission(Integer roleId);

    /**
     * 根据角色查询细粒度的权限
     * @param roleId
     * @return
     */
    List<ZtreeNodeDto_> selectRoleResources_(Integer roleId);

    Boolean saveRolePermission(Integer roleId, Integer[] resourceIds);
}
